import React, { Component, lazy } from 'react'
import { Router, Route, Switch } from 'react-router-dom'
// import Login from "./pages/Login"
// import Layout from "./pages/Layout"
// import Test from "./pages/Test"
import AuthRoute from 'components/AuthRoute'
import history from 'utils/history'
import { Suspense } from 'react'
const Login = lazy(() => import('pages/Login'))
const Layout = lazy(() => import('pages/Layout'))
const Test = lazy(() => import('pages/Test'))
export default class App extends Component {
    render() {
        return (
            <Router history={history}>
                <Suspense fallback={<h1>loading.....</h1>}>
                    <Switch>
                        <Route path='/test' component={Test} />
                        <Route path='/login' component={Login} />
                        <AuthRoute path='/' component={Layout} />
                    </Switch>
                </Suspense>
            </Router>
        )
    }
}
